package cn.xpg.controller;

import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import cn.xpg.entity.Comment;
import cn.xpg.service.CommentService;

@Controller
public class CommentController {

	@Resource(name = "commentService")
	private CommentService commentService;

	// 新增评论
	@RequestMapping("addComment.do")
	public String addcompany(@Valid Comment comment) {
		System.out.println("新增评论！！！！！！！！！！————>addComment");
		if (commentService.addComment(comment) > 0) {
			System.out.println("新增成功！！！！！");
		}
		return "/jsp/system/advice";
	}
}
